
class Shouye {
    constructor() {
        this.sp = $(".menu1 span");
        this.heiwu = $(".heiwu")
        this.cart=$(".cart");
        this.lb = document.getElementById("baosha");
        this.init();
        this.bindEvent();


    }
    init() {
        this.a = location.href;

        console.log(this.a.split("=")[1]);
        if (this.a.split("=")[1] != undefined) {
            console.log(this.lb);

            this.lb.innerText = this.a.split("=")[1];
        }
        else {

            this.lb.innerText = "请登录";
        }
    }
    bindEvent() {
        this.lb.onclick = () => {
            location.href = "http://localhost:3000/dist/login.html"
        }
        this.sp.mouseover(() => {

            this.heiwu.css("display", "block");
        });
        this.sp.mouseout(() => {

            this.heiwu.css("display", "none");
        });
        this.cart.click(()=>{
            location.href = "http://localhost:3000/dist/cart.html"
        })


    }


}


new Shouye();